import Cookies from 'js-cookie';

const TokenKey = 'token';
const ExpKey = 'exp';
const TKenTypeKey = 'TKenType';
const userKey = 'user';

//token
export function getToken() {
  // return Cookies.get(TokenKey)
  return sessionStorage.getItem(TokenKey);
}
export function setToken(token) {
  // Cookies.set(TokenKey, token)
  sessionStorage.setItem(TokenKey, token);
}
export function removeToken() {
  // Cookies.remove(TokenKey)
  sessionStorage.removeItem(TokenKey);
}

// //过期时间
// export function getExp() {
//   return Cookies.get(ExpKey);
// }
// export function setExp(exp) {
//   Cookies.set(ExpKey, exp);
// }

//token类型
export function getTKenType() {
  return Cookies.get(TKenTypeKey);
}
export function setTKenType(TKenType) {
  Cookies.set(TKenTypeKey, TKenType);
}

//用户信息
export function getUser() {
  return Cookies.get(userKey);
}
export function setUser(user) {
  Cookies.set(userKey, user);
}
